<template>
  <ProductGrid 
    :products="productList"
    @add-to-cart="handleAddToCart"
  />
</template>

<script>
import ProductGrid from './xztdemo2.vue'

export default {
  components: {
    ProductGrid
  },
  data() {
    return {
      productList: [
        {
          id: 1,
          title: "捞鱼·2024年 即食海参礼盒699型",
          image: "https://safood-1317438654.cos.ap-guangzhou.myqcloud.com/tempImage/17338001966757b104cebae.jpg",
          price: "99",
        },
        {
          id: 2,
          title: "捞鱼·2024年 即食海参礼盒699型",
          image: "https://safood-1317438654.cos.ap-guangzhou.myqcloud.com/tempImage/17338001966757b104cebae.jpg",
          price: "99",
        },
        {
          id: 3,
          title: "捞鱼·2024年 即食海参礼盒699型",
          image: "https://safood-1317438654.cos.ap-guangzhou.myqcloud.com/tempImage/17338001966757b104cebae.jpg",
          price: "99",
        },
        {
          id: 4,
          title: "捞鱼·2024年 即食海参礼盒699型",
          image: "https://safood-1317438654.cos.ap-guangzhou.myqcloud.com/tempImage/17338001966757b104cebae.jpg",
          price: "99",
        }
      ]
    }
  },
  methods: {
    handleAddToCart(product) {
      // 处理添加到购物车的逻辑
      console.log('Adding to cart:', product)
    }
  }
}
</script>